package com.yitong;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.DatagramPacket;
import java.net.DatagramSocket;
import java.net.InetAddress;

public class demo1 {
    public static void main(String[] args) throws IOException {
        //发送端
        DatagramSocket ds =new DatagramSocket();
        //键盘录入数据
        BufferedReader br =new BufferedReader(new InputStreamReader(System.in));
        String line;
        while ((line=br.readLine())!=null){
            if("886".equals(line)){
                break;
            }
            byte[] bys = line.getBytes();
            DatagramPacket dp =new DatagramPacket(bys,bys.length, InetAddress.getByName("192.168.74.1"),4444);
            ds.send(dp);
        }
        ds.close();
    }
}
